<template>
  <div class="card shadow d-none d-lg-block " id="perinfo-box">
    <div class="container text-center" >
      <img :src="HeadPor" style="width: 6.25rem;" class="m-auto img-fluid rounded-circle headerpor d-block">
      <span v-text="user.name" class=""></span>
    </div>
    <hr>
    <div class="card-body p-0 pl-3 pr-3">
      <div class="row">
        <div class="col ">
          <p class="text-secondary mb-0 ">关注</p>
          <p v-text="user.follow" class="text-primary mb-0"></p>
        </div>
        <div class="col flex-colum">
          <p class="text-secondary mb-0">粉丝</p>
          <p v-text="user.Fans" class="text-primary mb-0"></p>
        </div>
        <div class="col">
          <p class="text-secondary mb-0">私信</p>
          <p v-text="user.trends" class="text-primary mb-0"></p>
        </div>
      </div>
    </div>

  </div>

</template>

<script>
  // 单纯的 jqeruy
  $(function() {
    // $('#perinfo-box').click(function(){
    // alert("123")
    // })
  })
  // vue
  export default {
    name: "perinfo",
    data() {
      return {
        urlfix:"http://127.0.0.1:9000",
        HeadPor: "https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2155031989,2831569069&fm=115&gp=0.jpg",
        user: {
          name: "",
          //关注数量
          follow: 666,
          // 粉丝数量
          Fans: 222,
          //动态
          trends: 3
        }
      }
    },
    methods: {
      
    },
    beforeMount: function() {
      let that=this
      let url=that.urlfix+"/personal/selectUserInfo"
      that.userEmail=window.sessionStorage.getItem("userEmail")
      let data={userEmail:that.userEmail}
      $.post(url,data,(data)=>{
        that.user.name=data.data.userName
        that.user.follow=data.data.userFollowers
        that.user.Fans=data.data.userFans
      })
      // alert("更新数据完成")
    }
  }
</script>

<style  scoped>

</style>
